package chapter8.java;

/**
 * @Author juzipi
 * @Date 2021/5/24 14:08
 * @Info
 */
public class StackAllocation {

    public static void main(String[] args) {

        long start = System.currentTimeMillis();
        for (int i = 0; i < 10000000; i++) {
            alloc();
        }
        long end = System.currentTimeMillis();
        System.out.println("时间"+(end-start));
        try {
            Thread.sleep(1000000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

    private static void alloc(){
        User user = new User();//未发生逃逸
    }

    static class User{

    }

}
